package com.talentgame.tankspk.GameCore;

import com.badlogic.gdx.graphics.g3d.Model;
import com.badlogic.gdx.physics.bullet.collision.Collision;
import com.badlogic.gdx.physics.bullet.collision.btCollisionObject;
import com.badlogic.gdx.physics.bullet.dynamics.btRigidBody;
import com.badlogic.gdx.utils.Disposable;

/**
 * Created by 54560 on 2016/12/22.
 */
public class Obstacle extends GameObject implements Disposable{

    public Obstacle(Model model) {
        super(model);
    }

    public Obstacle(Model model, String nodeId) {
        super(model, nodeId);
        body.setCollisionFlags(body.getCollisionFlags() | btCollisionObject.CollisionFlags.CF_KINEMATIC_OBJECT);
        body.setContactCallbackFlag(TanksGame.OBJECT_FLAG);
        body.setContactCallbackFilter(0);
        body.setActivationState(Collision.DISABLE_DEACTIVATION);
        instantiate(Obstacle.this,true);
    }

    @Override
    protected btRigidBody.btRigidBodyConstructionInfo getConstructionInfo() {
        SetMass(0);
        return super.getConstructionInfo();
    }

    @Override
    public void dispose() {
        super.dispose();
    }
}
